﻿<ad:DocumentContent x:Class="IllSoft.Xvcc.WpfUI.ChannelWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
    xmlns:clr="clr-namespace:IllSoft.Xvcc.Volano.Client;assembly=IllSoft.Xvcc.Volano.Client"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
	Title="Channel Window" Closing="Window_Closing"
    DefaultElement="{Binding ElementName=messageTextBox}" Width="640" Height="480"
    FocusManager.FocusedElement="{Binding ElementName=messageTextBox}">

    <ad:DocumentContent.Resources>
        <ObjectDataProvider x:Key="UsersDS" ObjectType="{x:Type clr:Users}" d:IsDataSource="True"/>
        <DataTemplate x:Key="UsersTemplate">
            <DataTemplate.Resources>
                <Storyboard x:Key="OnMouseEnter1"/>
            </DataTemplate.Resources>
            <StackPanel>
                <TextBlock Text="{Binding Path=Nick}" x:Name="textBlock"/>
                <TextBlock Text="{Binding Path=Profile}"/>
            </StackPanel>
            <DataTemplate.Triggers>
                <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="textBlock"/>
                <Trigger Property="IsMouseOver" Value="True">
                    <Trigger.ExitActions>
                        <BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
                    </Trigger.ExitActions>
                    <Trigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
                    </Trigger.EnterActions>
                </Trigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </ad:DocumentContent.Resources>

    <ad:DockingManager>
        <ad:ResizingPanel Orientation="Horizontal">
            <ad:DockablePane ad:ResizingPanel.ResizeWidth="200">
                <ad:DockableContent Title="{Binding Path=Count, Mode=Default, Source={StaticResource UsersDS}}" DockableStyle="DockableToBorders">
                    <ListView x:Name="usersListView" ItemTemplate="{DynamicResource UsersTemplate}">
                        <ListView.ContextMenu>
                            <ContextMenu>
                                <MenuItem ToolTip="Last Activity" Header="Last Activity"/>
                            </ContextMenu>
                        </ListView.ContextMenu>
                        <ListView.ItemsSource>
                            <Binding Mode="OneWay" Source="{StaticResource UsersDS}"/>
                        </ListView.ItemsSource>
                    </ListView>
                </ad:DockableContent>
            </ad:DockablePane>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <RichTextBox Name="messagesRichTextBox" Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                    <!--Background="#312d5a">-->
                    <RichTextBox.Resources>
                        <Style TargetType="{x:Type Paragraph}">
                            <Setter Property="Margin" Value="0" />
                        </Style>
                    </RichTextBox.Resources>
                    <!--<FlowDocument Name="messagesFlowDocument">
                        <Paragraph>
                            Test Run
                            <TextBlock>Test TextBlock</TextBlock>
                            <Bold>Test Run</Bold>
                            <LineBreak />
                            <Line></Line>
                            Test Run
                        </Paragraph>
                        <Paragraph>
                            <Run>Test Run</Run>
                            <TextBlock>Test TextBlock</TextBlock>
                            <Run>Test Run</Run>
                            <Line></Line>
                            <Run>Test Run</Run>
                        </Paragraph>
                    </FlowDocument>-->
                </RichTextBox>
                <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Height="5" />
                <Grid Grid.Row="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" Margin="0,0,3,0" Content="Nick" />
                    <TextBox Name="messageTextBox" TextWrapping="Wrap" AutoWordSelection="True" KeyDown="messageTextBox_KeyDown" Text="Test" Grid.Column="1" />
                    <CheckBox Name="antiIdleTimerCheckBox" Grid.Column="2" VerticalAlignment="Center" Content="Anti Idle Timer" Margin="3,0,3,0" HorizontalAlignment="Left" Checked="antiIdleTimerCheckBox_Checked" />
                </Grid>
            </Grid>
        </ad:ResizingPanel>
    </ad:DockingManager>
</ad:DocumentContent>
